﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UpdateServer
{
    public partial class Login : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            {
                Session["USERID"] = "";
            }
        }

      
        protected void IbtnEnter_Click(object sender, ImageClickEventArgs e)
        {
            string uname = username.Value.Trim();
            string pwd = password.Value.Trim();
            ServerDataTableAdapters.T_USERTableAdapter ad = new UpdateServer.ServerDataTableAdapters.T_USERTableAdapter();
            ServerData.T_USERDataTable users = ad.GetDataByLoginInfo(uname, pwd);
            if (users.Count > 0)
            {
                Session["USERID"] = users[0].ID;
                Response.Redirect("Default.aspx");
            }
            else
            {
                UpdateService.Alert("用户或密码错误!");
            }
        }
    }
}
